package com.elvis.springaopinaction.service.impl;

import com.elvis.springaopinaction.service.IAdviceTest;
import org.springframework.stereotype.Component;

/**
 * @Description 通知测试
 * @Date 2021/8/23 14:26
 * @Version 1.0
 */
@Component
public class AdviceTestImpl implements IAdviceTest {
    @Override
    public void afterAdviceTest() {
        System.out.println("业务逻辑正常处理...无异常");
    }

    @Override
    public void afterReturningAdviceTest() {
        System.out.println("业务逻辑处理...出现异常");
        int i = 1/0;
    }

    /**
     * 五种异常的执行顺序测试(正常业务)
     */
    @Override
    public void allAdviceExecutionOrderTest() {
        System.out.println("正常执行业务.....");
    }

    @Override
    public void allAdviceExecutionContainExceptionOrderTest() {
        System.out.println("执行业务存在异常.....");
        int i = 1/0;
    }


}
